/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 bitmap_raw.h

	$Header: /heroes4/bitmap_raw.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( BITMAP_RAW_H_INCLUDED )
#define BITMAP_RAW_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "abstract_bitmap.h"
#include "counted_ptr.h"
#include "memory_bitmap.h"
#include "memory_bitmap_typedef.h"
#include "pixel_24.h"
#include "resource_traits.h"


/////////////////////////////////////////////////////////////////////////////
// bitmap_raw class handles the load/save of raw 24 bit bitmaps.

//this bitmap raw class is used by the editor

class t_progress_handler;

class t_bitmap_raw_24 : public t_memory_bitmap24
{
public:
	
	// Constructors / Destructor
	t_bitmap_raw_24();
	virtual ~t_bitmap_raw_24();
	
	// Member functions	
	bool						read( std::streambuf& buffer, t_progress_handler* handler );
	bool						write( std::streambuf& buffer ) const;

	bool						init(int width, int height, t_memory_bitmap32 & source_bitmap);
	
protected:


};

//this bitmap_raw class is used in the game

class t_bitmap_raw_16 : public t_memory_bitmap16
{
public:
	
	// Constructors / Destructor
	t_bitmap_raw_16();
	explicit t_bitmap_raw_16( t_bitmap_raw_24 const& source);
	virtual ~t_bitmap_raw_16();
	
	void draw_to( t_screen_rect source_rect, t_abstract_bitmap16& dest,
		t_screen_point dest_point ) const;
	
protected:


};

typedef t_counted_ptr<t_bitmap_raw_24> t_bitmap_raw_24_ptr;

/////////////////////////////////////////////////////////////////////////////

template <>
struct t_resource_traits<t_bitmap_raw_24>
{
	static char const prefix[];
	static char const extension[];
};

/////////////////////////////////////////////////////////////////////////////
#endif // !defined( BITMAP_RAW_H_INCLUDED )
